chore(m5): drop core connector engine + DB v5 migration#115
Merged
Conversation
Removes the connector subsystem from @spool-lab/core: the engine,
scheduler, registry, plugin loader, capabilities, prerequisite checker,
trust store, all capture queries and tests. Adds a v5 schema migration
that drops connector tables on existing user DBs and narrows the stars
CHECK constraint to session-only. The renderer / main process / CLI
already stopped using these in earlier PRs.
src/connectors/: deleted entirely (27 files, ~3700 LOC) — engine,
scheduler, registry, loader, npm-install, prerequisites, trust-store,
capabilities, types, all tests.
src/db/queries.ts:
- Drop searchCaptures, searchAll, searchCaptureRows, mapCaptureRows,
mergeCaptureGroups, insertCapture, getCaptureCount,
compareSearchResultRelevance, getMatchTypePriority
- Narrow getStarredUuidsByType return to { session: string[] }
- Narrow listStarredItems to session-only
- Drop CaptureResult / Capture / CapturedItem / SearchResult / Source
type imports
src/db/db.ts:
- Schema block: remove captures / captures_fts / captures_fts_trigram /
capture_connectors / connector_sync_state tables, their indexes, and
the 'connector' source row insert; narrow stars CHECK to
item_type = 'session'
- Trigger block: remove captures_fts_insert / captures_fts_delete (kept
the DROP TRIGGER lines so existing-user upgrade cleans them out via v5)
- Wrap historical v1-v3 migrations in try/catch — they reference tables
that fresh installs no longer create
- Add v5 migration: drops connector tables/triggers/FTS shadow tables,
deletes capture stars, rebuilds stars with narrow CHECK, drops the
'connector' source row
- Drop maintenance: rebuildFtsTableIfEmpty for captures, capture-orphan
stars prune (no captures table to filter against)
src/types.ts:
- Delete CaptureResult, Capture, CapturedItem export
- Narrow SearchResult to fragment-only
- Narrow StarKind to 'session'
- Narrow StarredItem to session-only
src/index.ts: drop all connector exports + connector-sdk re-exports.
package.json: drop @spool-lab/connector-sdk, effect, semver, tar deps
and their @types; drop the connector-sdk filter from the build script.
Tests:
- Add src/db/migration-v5.test.ts: seeds a v4 DB with capture data, runs
getDB(), verifies tables dropped + stars narrowed + session stars
preserved + capture inserts now rejected; plus a fresh-install no-op
case
- Rewrite src/db/stars.test.ts to session-only (drops 5 capture-specific
cases, removes seedCapture helper)
Bundle/footprint:
- Net -6007 / +124 in core
- App main bundle 56.65 kB → 55.72 kB
- App loader chunk 308.57 kB → gone (replaced by syncer chunk at 68 kB)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous commit removed @spool-lab/connector-sdk, effect, semver, tar (and @effect/vitest, @types/semver dev deps) from packages/core/package.json without re-running pnpm install. CI's --frozen-lockfile install rejected the drift. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 28, 2026
graydawnc
added a commit
that referenced
this pull request
Apr 28, 2026
The 0.4.0 npm publish shipped stale dist artifacts (commands/connector.js and connector-shared.js from before #114 deleted them, plus core's connectors/ subtree from before #115). tsc only writes new files; it does not delete outputs whose source has been removed. The published tarballs were functional (the CLI entry doesn't import the orphans) but ~37 kB heavier than they should be. Fix: prepend `pnpm run clean` (already defined as `rm -rf dist`) to the build script so every fresh build starts from an empty dist/. Verified locally — cli dist now contains only the 5 surviving commands and core dist no longer carries a connectors/ tree. Bump cli + core to 0.4.1 so the clean build can be published. App, landing, and root version stay at 0.4.0 — the Electron release on GitHub is unaffected by this fix and we don't need to cut another DMG just for npm hygiene. Co-authored-by: Chen <99816898+donteatfriedrice@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Continuation of #112 / #113 / #114. Removes the connector subsystem from
@spool-lab/core— engine, scheduler, registry, plugin loader, capabilities, prerequisite checker, trust store, all capture queries — and adds a v5 schema migration that drops the connector tables on existing user DBs and narrows thestarsCHECK constraint to session-only.The renderer (#112), main process (#113), and CLI (#114) already stopped consuming any of this surface, so the cut is contained to
packages/core/. Nothing else needed to change.-6007 / +317net.Migration story
captures/captures_fts/captures_fts_trigram/capture_connectors/connector_sync_state+ their triggers, deletes capture stars, rebuildsstarswith the narrowed CHECK, drops the'connector'source row. Captures data is gone — by design (users were/will be directed to Spool Daemon for connector functionality).stars; v5 narrows it via the rebuild round-trip.Schema diff (
packages/core/src/db/db.ts)captures,captures_fts,captures_fts_trigram,capture_connectors,connector_sync_statetables and their indexes; narrowedstarsCHECK toitem_type = 'session'; dropped the'connector'source row from the seed insertcaptures_fts_insert/captures_fts_deletetriggers (kept their DROP IF EXISTS for upgrade cleanup)Other changes
src/connectors/— deleted entirely (27 files, ~3700 LOC)src/db/queries.ts— droppedsearchCaptures,searchAll,searchCaptureRows,mapCaptureRows,mergeCaptureGroups,insertCapture,getCaptureCount,compareSearchResultRelevance,getMatchTypePriority; narrowedgetStarredUuidsByTypeandlistStarredItemsto session-onlysrc/types.ts— deletedCaptureResult,Capture,CapturedItemexports; narrowedSearchResult,StarKind,StarredItemsrc/index.ts— dropped all connector + connector-sdk re-exportspackage.json— dropped@spool-lab/connector-sdk,effect,semver,tardeps + their@types; removed connector-sdk filter from build scriptNew tests
src/db/migration-v5.test.ts— seeds a hand-built v4 DB with a session, a capture, a capture star, a connector_sync_state row; runsgetDB(); verifies tables dropped, capture stars gone, session star kept, capture inserts now rejected,'connector'source row gone,user_version = 5. Plus a fresh-install no-op case.src/db/stars.test.ts— rewritten session-only (5 capture-specific cases removed,seedCapturehelper gone)Features that should still work post-PR (verified)
pnpm buildclean (no connector-sdk filter; justtsc)searchFragmentsshapekind: 'fragment'round-trip viaspool searchgetStarredUuidsByType{ session: string[] }typed end-to-endlistStarredItemspnpm exec tsc --noEmitcleanpnpm build:electronclean — main bundle 56.65 kB → 55.72 kB, loader chunk 308.57 kB → gone (replaced by syncer chunk at 68 kB)pnpm buildclean, 21/21 tests passspool syncspool status5 total (claude: 5, codex: 0, gemini: 0)spool search XYLOPHONE_CANARY_42user_version = 5Test plan
pnpm test(core) 48/48 pass including new migration-v5 testpnpm test(cli) 21/21 passpnpm build:electron(app) cleanspool sync / status / searchsmoke against real Claude fixturesuser_version = 5🤖 Generated with Claude Code